package mk.gamemap.model
{
	import game.tileMap.model.vo.MapObj;

	public class MapFactory
	{
		public static var costList:Array;
		public static var xml:XML;
		public function MapFactory()
		{
		}
		public static function creatMap(id:String):MapData{
			var map_xml:XML=XML(xml.map.(@id==id) )
				trace("地图XML："+map_xml)
			return new MapData(map_xml);
		}
		
		public static function creatMapSprite(id:String,map:TileMapModel0,x:int,y:int,passable:Boolean,eventId:int):MapObj{
			var mapSp:MapObj
			switch (id){
				case "0":
					//mapSp=new Player(map);
					break;
				case "1":
					 mapSp=new MapObj();
					break;
				case "2":
				//	mapSp=new Character(map);
					break;
			}
			
			
			mapSp.x=x
			mapSp.y=y;
			mapSp.through=passable;
			mapSp.eventId=eventId;
			return mapSp;
		}
	}
}